package com.surfacing.rcp.client.listeners;

import java.util.ArrayList;

import com.surfacing.rcp.client.modelManager.ModelFactory;
import com.surfacing.rcp.client.modelManager.StatNfsManager;
import com.surfacing.rcp.model.common.AbstractMessage;
import com.surfacing.rcp.model.entity.StatNfs;

/**
 * This class will be notified uppon staff member changes
 * 
 * @author Michael
 */
public class StatNfsListener extends ClientListenerAdapter {
	StatNfsManager manager = ModelFactory.getInstance().getStatNfsManager();

	@Override
	public void add(AbstractMessage addMessage) {
		manager.add((StatNfs) addMessage);
	}

	@Override
	public void update(AbstractMessage updateMessage) {
		manager.update((StatNfs) updateMessage);
	}

	@Override
	public void remove(AbstractMessage removeMessage) {
		manager.remove((StatNfs) removeMessage);
	}

	@Override
	public void list(ArrayList<AbstractMessage> listMessage) {
		manager.removeAllElements();
		for (AbstractMessage msg : listMessage) {
			StatNfs member = (StatNfs) msg;
			manager.add(member);
		}
	}
}
